package com.bishe.psy.service;

import com.bishe.psy.model.Message;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * Created with Intellij IDEA.
 * Description:
 * User: L
 * Date: 2024-04-30
 * Time: 12:17
 */


public interface IMessageService {

    //发送一条咨询信息
    void create (Message message);

    //根据用户id查询咨询师未读数查询未读的信息
    Integer selectUnreadCount(Long receiveUserId,Long currentIdentity);

    //根据接收者用户id查询所有站内信
    List<Message> selectByReceiveUserId(Long receiveUserId);

    List<Message> selectByReceiveUserIdStu(Long receiveUserId);

    //更新某篇站内信的状态，0-未读，1-已读，2-已回复
    void updateStateById(Long id, Byte state);

    //根据id查询某条站内信
    Message selectByPrimaryKey(Long id);

    //回复站内信
    @Transactional
    void reply(Long replyId,Message message);
}
